package com.bwie.utils;

import io.swagger.models.auth.In;
import lombok.Data;

import java.io.Serializable;

@Data
public class Rest implements Serializable {

    private Integer code;

    private String msg;

    private Object data;

    public static Rest OK(){

        Rest rest = new Rest();
        rest.setMsg("操作成功");
        rest.setCode(200);
        rest.setData(null);

        return rest;
    }
     public static Rest Error(){

         Rest rest = new Rest();
         rest.setMsg("操作失败");
         rest.setCode(500);
         rest.setData(null);
         return rest;
    }


    public Integer getCode() {
        return code;
    }

    public Rest setCode(Integer code) {
        this.code = code;

        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Rest setMsg(String msg) {
        this.msg = msg;

        return this;
    }

    public Object getData() {
        return data;
    }

    public Rest setData(Object data) {
        this.data = data;

        return this;
    }
}
